window.onload = function() {
	respondwindows();
}
window.onbeforeunload=function(){
	respondwindows();
}
window.onunload=function(){
	respondwindows();
}
window.onresize = respondwindows;
// 
function respondwindows() {
	
	var contents = document.getElementsByClassName("conts");
	var mainbody = document.getElementsByClassName("main_body");
	var header = document.querySelector("header");

	console.log(header);
	var displays = ["25%", "50%", "25%"];

	if (mainbody[0].clientWidth <= 700) {
		mainbody[0].style.display = "block";
		header.style.height = "200px";
		for (var i = 0; i < contents.length; i++) {
			contents[i].style.display = "flexbox";
			contents[i].style.width = "100%";
		}
	} else {
		mainbody[0].style.display = "flex";
		header.style.height = "400px";
		for (var i = 0; i < contents.length; i++) {
			contents[i].style.display = "inline-flex";
			contents[i].style.width = displays[i];
		}
	}
	console.log(contents[1].style.display);

}
